/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.defaultCode;


import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Watchdog;
import java.util.Date;
import java.util.Timer;

public class DefaultRobot extends IterativeRobot
{

    DriverStation driverStation;

    DriveTrain dt;
    Timer runTimer;
    Controller controller;

    public DefaultRobot()
    {
        driverStation = DriverStation.getInstance();
        controller = new Controller();
        runTimer = new Timer();
    }


	/********************************** Init Routines *************************************/

	public void robotInit()
        {
            controller.initialize();
	}

	public void disabledInit() {

	}

	public void autonomousInit()
        {
            controller.initialize();
	}

	public void teleopInit()
        {
            controller.initialize();
            runTimer.schedule(controller, new Date(), 10);
	}

	public void disabledPeriodic()
        {
		Watchdog.getInstance().feed();
	}

	public void autonomousPeriodic()
        {
		// feed the user watchdog at every period when in autonomous
		Watchdog.getInstance().feed();
	}


	public void teleopPeriodic()
        {
            Watchdog.getInstance().feed();
	}
}
